package com.rupertjones.globalcron.resources;

import org.brownflat.dbinit.upgrade.Upgrade;
import org.springframework.stereotype.Component;

/**
 * <p>&copy Rupert Jones 2011,2012</p>
 *
 * @author rup
 */
@Component
public class Upgrade0002ExecutionLog implements Upgrade {
    @Override
    public int getSequence() {
        return 2;
    }

    @Override
    public String getSql() {
        return "CREATE TABLE `job_exec_log` (\n" +
                "  `id` int(11) NOT NULL AUTO_INCREMENT,\n" +
                "  `output` LONGTEXT,\n" +
                "  `job` int(11) NOT NULL,\n" +
                "  `last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE KEY `id_UNIQUE` (`id`)\n" +
                ") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;";
    }

    @Override
    public String getName() {
        return "Create execution log";
    }
}
